<template>
    <div class="main">
        <button class="down-btn" type="button" @click="download">
            {{ t("message.download_button") }}
        </button>
    </div>
</template>

<script setup lang="ts">
import {useI18n} from "vue-i18n";

const {t} = useI18n();

const download = () => {
    // todo Rigela下载地址
    const url = "http://rigela.site/rigela/rigela_x64/rigela-main.exe";
    const file_name = 'rigela.exe';

    const link = document.createElement('a');
    link.href = url;
    link.download = file_name;
    document.body.appendChild(link);

    link.click();
    document.body.removeChild(link);
}
</script>

<style scoped>
.main {
    width: 80%;
    height: 200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.down-btn {
    background-color: chocolate;
}
</style>